package com.meida.module.bus.client.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.NoArgsConstructor;

/**
 * 余额类型
 *
 * @author gp
 * @date 2021/8/9
 */
@NoArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@ApiModel("余额类型")
public enum BalanceLogTypeEnum {
    /**
     * 余额类型
     */
    logType1(1, "充值"),
    logType2(2, "消费"),
    logType3(3, "佣金"),
    logType4(4, "提现"),
    logType5(5, "退回"),
    logType6(6, "邀请赠送");

    @EnumValue
    private Integer value;
    private String label;

    BalanceLogTypeEnum(Integer value, String label) {
        this.value = value;
        this.label = label;
    }


    public void setValue(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }


    public static BalanceLogTypeEnum getByValue(Integer value) {
        for (BalanceLogTypeEnum balanceLogTypeEnum : values()) {
            if (balanceLogTypeEnum.getValue() == value) {
                return balanceLogTypeEnum;
            }
        }
        return null;
    }
}
